// import Vue from "vue";
import Vue from 'vue/dist/vue.js';
import VueRouter from "vue-router";

import App from "./App.vue";
import About from './components/About.vue'
import News from './components/News.vue'
import Course from './components/Course.vue'
import Showcase from './components/Showcase.vue'
import Cooperation from './components/Cooperation.vue'
import Contactus from './components/Contactus.vue'
import Detail from './components/Detail.vue'
import Mobile from './components/Mobile.vue'

// 手机端字体大小设置
import remAndPhoneConfig from './config/remConfig'
remAndPhoneConfig();

import './assets/css/mobile.css'

Vue.use(VueRouter);

Vue.config.productionTip = false;

// 1. 定义 (路由) 组件。
// 可以从其他文件 import 进来
// const Foo = { template: "<div>foo</div>" };
// const Bar = { template: "<div>bar</div>" };

// 2. 定义路由
// 每个路由应该映射一个组件。 其中"component" 可以是
// 通过 Vue.extend() 创建的组件构造器，
// 或者，只是一个组件配置对象。
// 我们晚点再讨论嵌套路由。
const routes = [
  { path: "/", component: About },//pc端首页
  { path: "/news", component: News },
  { path: "/course", component: Course },
  { path: "/showcase", component: Showcase },
  { path: "/cooperation", component: Cooperation },
  { path: "/contactus", component: Contactus },
  { path: "/detail/:id", component: Detail },
  { path: "/mobile", component: Mobile },//手机端首页
];

// 3. 创建 router 实例，然后传 `routes` 配置
// 你还可以传别的配置参数, 不过先这么简单着吧。
const router = new VueRouter({
  routes // (缩写) 相当于 routes: routes
});

new Vue({
  router,
  render: h => h(App)
}).$mount("#app");
